﻿var firstNames = ["Toán", "Lý", "Hóa", "Văn", "Sử", "Địa", "Anh Văn"],
    lastNames = ["Kiểm tra miệng", "Kiểm tra 15 phút", "Kiểm tra 1 tiết"],
    cities = ["5", "6", "7", "8", "9", "10"],
    titles = ["Nguyễn Thị Lan", "Vũ Diệu Huyền", "Trần Công Định", "Vũ Tuấn Thăng"],
    birthDates = [new Date("2011/12/08"), new Date("2011/02/19"), new Date("2011/08/30"), 
	new Date("2011/09/19"), new Date("2011/03/04"), new Date("2011/07/02"), new Date("2011/05/29")
	, new Date("2011/01/09"), new Date("2011/01/27"), new Date("2011/03/27")];
	
var StudentName = ["Nguyễn Văn Bình","Trần Văn Toán","Vũ Thị Hợi","Lê Tuất","Thị Dậu","Văn Long","Xuân Thìn","Tấn Sửu"],
	BirthDate = [new Date("1995/12/08"), new Date("1995/02/19"), new Date("1995/08/30"), 
	new Date("1995/09/19"), new Date("1995/03/04"), new Date("1995/07/02"), new Date("1995/05/29")
	, new Date("1995/01/09"), new Date("1995/01/27"), new Date("1995/03/27")],
	Sex = ["Nam", "Nữ"],
	PhoneNumber =["0912345677", "0912345889", "09123343433"];


function createRandomStudent(count) {
    var data = [],
        now = new Date();
    for (var i = 0; i < count; i++) {
		
        var firstName = StudentName[Math.floor(Math.random() * StudentName.length)],
            birthDate = BirthDate[Math.floor(Math.random() * BirthDate.length)],
			sex = Sex[Math.floor(Math.random() * Sex.length)],
			phoneNumber = PhoneNumber[Math.floor(Math.random() * PhoneNumber.length)];

        data.push({
            Id: i +  1,
			StudentCode: 'HS00' + i ,
            StudentName: firstName,
            BirthDate: birthDate,
			Sex: sex,
            PhoneNumber: phoneNumber
        });
    }
    return data;
}


function createRandomData(count) {
    var data = [],
        now = new Date();
    for (var i = 0; i < count; i++) {
        var firstName = firstNames[Math.floor(Math.random() * firstNames.length)],
            lastName = lastNames[Math.floor(Math.random() * lastNames.length)],
            city = cities[Math.floor(Math.random() * cities.length)],
            title = titles[Math.floor(Math.random() * titles.length)],
            birthDate = birthDates[Math.floor(Math.random() * birthDates.length)],
            age = 'liên hệ';

        data.push({
            Id: i + 1,
            FirstName: firstName,
            LastName: lastName,
            City: city,
            Title: title,
            BirthDate: birthDate,
            Age: age
        });
    }
    return data;
}
